-
-
Notifications
You must be signed in to change notification settings - Fork 5
Add polyfills for Stream.DisposeAsync(), TextReader.DisposeAsync(...), TextWriter.DisposeAsync(...)
#67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
….)`, `TextWriter.DisposeAsync(...)`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds polyfills for the DisposeAsync() method to Stream, TextReader, and TextWriter classes, enabling asynchronous disposal for platforms that don't natively support these methods (pre-.NET Core 3.0). The implementations check for native IAsyncDisposable support when available and fall back to wrapping synchronous Dispose() calls in Task.Run().
Key changes:
- Added
DisposeAsync()polyfill implementations for Stream, TextReader, and TextWriter classes - Updated documentation to reflect the addition of 4 new member signatures (3 DisposeAsync methods + Task.Yield)
- Applied appropriate conditional compilation directives to target platforms lacking native support
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| PolyShim/Signatures.md | Updated signature counts and added documentation entries for new DisposeAsync() methods and Task.Yield() |
| PolyShim/NetCore30/Stream.cs | Implemented DisposeAsync() polyfill for Stream with fallback logic |
| PolyShim/NetCore30/TextReader.cs | Implemented DisposeAsync() polyfill for TextReader with fallback logic |
| PolyShim/NetCore30/TextWriter.cs | Implemented DisposeAsync() polyfill for TextWriter with fallback logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Stream.DiposeAsync(), TextReader.DisposeAsync(...), TextWriter.DisposeAsync(...)Stream.DisposeAsync(), TextReader.DisposeAsync(...), TextWriter.DisposeAsync(...)
No description provided.